package team.xiaobaiya.gptchatrobot.handler.chat;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import team.xiaobaiya.gptchatrobot.gpt.GptClient;
import team.xiaobaiya.gptchatrobot.rights.RightsManager;

import javax.annotation.PostConstruct;

/**
 * 对话处理配置
 *
 * @ClassName ConverseHandleConfig
 * @Author Feng Yingnan
 * @Email fengyn1211@163.com
 * @Date 2023/4/6 17:18
 */
@Slf4j
@Configuration
public class ConverseHandleConfig {

    @Autowired
    GptClient gptClient;
    @Autowired
    RightsManager rightsManager;

    @PostConstruct
    private void init() {
        // 设置gpt客户端
        ConverseHandleWrapper.gptClient = this.gptClient;
        // 设置权限管理器
        ConverseHandleWrapper.rightsManager = this.rightsManager;
    }

}
